for i in range(1,10):
    # 遍历1到9，因为包前不包后，所以是10
    for n in range(1,i+1):
        # 遍历1到i+1的赋值，例如i等于2时，n等于3，因为包前不包后，所以取值2
        print('{}*{}={:<4}'.format(n,i,n*i),end='')
        # 打印n*i的值
    print('')
print('')
print('='*60)

for i in range(9,0,-1):
    # 从9开始往后遍历到1
     for n in range (1,i+1):
         # 同上
         print('{}*{}={:<4}'.format(n,i, n * i), end='')
     print('')
print('')
print('='*60)

for i in range(1,10):
    for n in range (i,10):
         print(end='        ')
    for u in range(i,0,-1):
# 我实在不知道怎样对齐了
        print('{}*{}={:<4}'.format(u,i, u*i), end='')
    print('')
print('')
print('='*60)

for i in range(9,0,-1):
    for n in range (9,i,-1):
         print(end='        ')
    for u in range(i,0,-1):
        print('{}*{}={:<4}'.format(u,i, u*i), end='')
    print('')
print('')



